#include "gray_app.h"
#include "software_iic.h" // 直接使用软件I2C



unsigned char Digtal; 

float gray_weights[8] = {-4.0f, -3.0f, -2.0f, -1.0f, 1.0f, 2.0f, 3.0f, 4.0f}; 

float g_line_position_error; 

void Gray_Init(void)
{
    // 测试软件I2C连接
    if(Ping() == 0) {
        my_printf(&huart1, "Gray Sensor Connected Successfully!\r\n");
    } else {
        my_printf(&huart1, "Gray Sensor Connection Failed!\r\n");
    }
}

void Gray_Task(void)
{

		uint8_t temp = 0;
		temp = IIC_Get_Digtal();
		if(temp == 0xAA)
		{
			return;
		}
    Digtal=~temp;
		my_printf(&huart1,"%d\r\n",Digtal);
	

}
